package com.smartfactory.sail.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.smartfactory.sail.dto.GetOrderItemByCustId;
import com.smartfactory.sail.entity.Cust;
import com.smartfactory.sail.entity.OrderItem;
import com.smartfactory.sail.vo.item.indexWpResp;
import com.smartfactory.sail.vo.order.ListHTOrderListResp;
import com.smartfactory.sail.vo.order.ListOrderItemInfoResp;
import com.smartfactory.sail.vo.order.ListOrderItemRsp;
import com.smartfactory.sail.vo.order.PackingDetailResp;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 订单产品表 Mapper 接口
 * </p>
 *
 * @author 王巨壁
 * @since 2019-07-24
 */
@Mapper
public interface OrderItemMapper extends BaseMapper<OrderItem> {

    Page<ListOrderItemInfoResp> getSendGoodsInfoList(IPage<ListOrderItemInfoResp> page, @Param("ew") Wrapper<ListOrderItemInfoResp> queryWrapper);

    IPage<ListOrderItemRsp> getOrderItemPage(IPage<ListHTOrderListResp> page, @Param("ew") Wrapper<ListHTOrderListResp> queryWrapper);

    Boolean updateStatus(OrderItem orderItem);

    List<GetOrderItemByCustId> getByCustId(@Param("custId") Long custId);

    OrderItem getOneByOrderIdAndItemId(@Param("orderId") Long orderId, @Param("itemId") Long itemId);

    Cust getCustInfoByItemId(@Param("itemId") Long itemId);

    List<PackingDetailResp> findPackingDetail(@Param("custId") Long custId);
    List<PackingDetailResp> requestPacking(@Param("orderId") Long orderId, @Param("itemId") Long itemId);

    int selectStatCount(@Param("deptId") long deptId, @Param("statusEnum") Integer statusEnum);

    List<indexWpResp> indexWp(@Param("deptId") long deptId);
}
